//
//  SVWebViewControllerActivityjubao.m
//  SelfDriving
//
//  Created by apple on 16/9/23.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "SVWebViewControllerActivityjubao.h"
#import "ReportViewController.h"
@implementation SVWebViewControllerActivityjubao
- (NSString *)activityTitle {
    return NSLocalizedStringFromTable(@"举报", @"SVWebViewController", nil);
}

- (BOOL)canPerformWithActivityItems:(NSArray *)activityItems {
    for (id activityItem in activityItems) {
        if ([activityItem isKindOfClass:[NSURL class]] && [[UIApplication sharedApplication] canOpenURL:activityItem]) {
            return YES;
        }
    }
    return NO;
}

- (void)performActivity {
    NSLog(@"举报");
    UIStoryboard *customerStoryboard = [UIStoryboard storyboardWithName:@"MS"
                                                                 bundle:[NSBundle mainBundle]];
    ReportViewController *searchResultDetailController = [customerStoryboard instantiateViewControllerWithIdentifier:@"ReportViewController"];
    UINavigationController* nav = [[AppDelegate shareDelegate]._tableBarController.viewControllers objectAtIndex:[AppDelegate shareDelegate]._tableBarController.selectedIndex];
    UIViewController *rootview = [nav.viewControllers objectAtIndex:0];

    searchResultDetailController.type = @"2";
    NSString *url= [self.URLToOpen absoluteString];
    NSString *encodedValue = [url stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    searchResultDetailController.content = encodedValue;
    [rootview.navigationController pushViewController:searchResultDetailController animated:YES];
    
}
@end
